package huaan.com.mvvmdemo.http


import androidx.annotation.Nullable
import com.example.baselib.databean.ResponseData
import com.example.baselib.databean.UserData
import okhttp3.ResponseBody
import retrofit2.Response
import retrofit2.http.*
import java.util.HashMap

interface RequestService {

    /**
     * 用户名密码登录
     */
    @GET("login")
    suspend fun loginByPwd(
        @Query("uniqueid") uniqueid: String,
        @Query("comename") comename: String,
        @Query("password") password: String
    ): Response<UserData>

    /**
     * 获取登录验证码
     */
    @GET("verificationcode")
    suspend fun getLoginVerCode(@Query("phoneNum") tel: String): Response<ResponseData<String>>

    /**
     * 验证码登录
     */
    @GET("loginbyverificationcode")
    suspend fun loginByTel(@Query("phoneNum") tel: String, @Query("verificationCode") vercode: String): Response<UserData>

    /**
     * 获取绑定手机验证码
     */
    @GET("bindphone/verificationcode")
    suspend fun getBindVerCode(@Query("phoneNum") tel: String, @Header("token") token: String): Response<ResponseData<String>>

    /**
     * 绑定手机号
     */
    @GET("bindphone/check")
    suspend fun bindTel(
        @Query("phoneNum") tel: String,
        @Query("verificationCode") verCode: String,
        @Header("token") token: String
    ): Response<ResponseData<String>>

    /**
     * 修改密码
     */
    @GET("user/pwd")
    suspend fun changePwd(
        @Query("oldPwd") oldPwd: String,
        @Query("newPwd") newPwd: String,
        @Query("confirmPwd") surePwd: String,
        @Header("token") token: String
    ): Response<ResponseData<String>>

    @GET("unit/safety/alarms")
    suspend fun  loadAlarmData(@Header("token") token: String, @Query("unitcode") unitcode: String): Response<ResponseData<String>>

    @GET("unit/safety/sensorname")
    suspend fun loadSenName(@Header("token") token: String, @Query("unitcode")  unitcode: String): Response<ResponseData<String>>

    @GET("unit/safety/sensors")
    suspend fun loadSenInfo(@Header("token") token: String, @Query("unitcode")  unitcode: String): Response<ResponseData<String>>

    @GET("unit/safety/curve")
    suspend fun loadLineChart(@Header("token")token: String, @QueryMap map: HashMap<String, String>): Response<ResponseBody>

    @GET("unit/safety/alarmreport")
   suspend fun loadReportData(@Header("token")token: String, @Query("unitcode") unitcode: String,@Query("dateStr") date: String) :Response<ResponseData<String>>

    @GET("unit/safety/sensorsdefine")
   suspend fun loadSensorInfo(@Header("token")token: String, @Query("unitcode") unitcode: String,@Query("sensornum") sensornum: String) :Response<ResponseData<String>>

    @GET("unit/person/index")
    suspend fun loadRyMainData(@Header("token")token: String, @Query("unitcode")unitcode: String): Response<ResponseData<String>>

    @GET("unit/person/personbyregion")
    suspend fun loadRyRegionData(@Header("token")token: String, @Query("unitcode")unitcode: String): Response<ResponseData<String>>

    @GET("unit/person/alarms")
    suspend fun loadRyAlarmData(@Header("token")token: String, @Query("unitcode")unitcode: String): Response<ResponseData<String>>

    @GET("unit/person/{type}")
    suspend fun loadRyPersonData( @Path("type")type: String,@Header("token")token: String, @Query("unitcode")unitcode: String): Response<ResponseData<String>>

    @GET("unit/person/personbyregiontype")
    suspend fun loadRyReportChart(@Header("token")token: String,  @Query("unitcode")unitcode: String):Response<ResponseData<String>>

    @GET("unit/video/index")
    suspend fun loadRcvData(@Header("token")token: String,  @Query("unitcode")unitcode: String): Response<ResponseData<String>>

    @GET("unit/video/camera/url")
    suspend fun loadUrl(@Header("token")token: String, @QueryMap map: HashMap<String, String>, @Query("streamType")streamType: Int): Response<ResponseData<String>>

    @GET("unit/safety/minelist")
    suspend fun loadSafeNickData(@Header("token")token: String): Response<ResponseData<String>>

    @GET("unit/person/indexList")
    suspend fun loadRydwNickData(@Header("token")token: String): Response<ResponseData<String>>

    @GET("")
    suspend fun loadNickData(@Header("token")token: String): Response<ResponseData<String>>


}